﻿using Common.Contract;
using Common.Contract.Warranty;
using Common.Contract.Warranty.Request;
using Common.Contract.Warranty.Response;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Warranty.ServiceCommand;
using Warranty.Web.Service.Core;

namespace Warranty.Web.Service
{
    public class WarrantyService : ServiceBase, IWarranty
    {
        #region Saleout confirm
        public SearchSaleOutVerificationResponse SearchSaleOutVerification(SearchSaleOutVerificationRequest request)
        {
            return new SearchSaleOutVerificationServiceCommand(Provider).Execute(request);
        }

        public ResponseRecord ConfirmSaleOut(ConfirmSaleOutRequest request)
        {
            return new ConfirmSaleOutServiceCommand(Provider).Execute(request);
        }
        #endregion

        #region Period Inquiry
        public SearchPeriodInquiryResponse SearchPeriodInquiry(SearchPeriodInquiryRequest request)
        {
            return new SearchPeriodInquiryServiceCommand(Provider).Execute(request);
        }
        #endregion

        #region Serial Chasing
        public SearchSerialChasingResponse SearchSerialChasing(SearchSerialChasingRequest request)
        {
            return new SearchSerialChasingServiceCommand(Provider).Execute(request);
        }
        #endregion
        public SearchResponseSMSResponse SearchResponseSMS(SearchResponseSMSRequest request)
        {
            return new SearchResponseSMSServiceCommand(Provider.ResponseSMS).Execute(request);
        }

        public RetrieveResponseSMSResponse RetrieveResponseSMS(RetrieveResponseSMSRequest request)
        {
            return new RetrieveResponseSMSServiceCommand(Provider.ResponseSMS).Execute(request);
        }

        public ResponseRecord UpdateResponseSMS(UpdateResponseSMSRequest request)
        {
            return new UpdateResponseSMSServiceCommand(Provider.ResponseSMS).Execute(request);
        }


        public SearchPndHistResponse SearchPndHistory(SearchPndHistRequest request)
        {
            return new SearchPndHistServiceCommand(Provider).Execute(request);
        }


        public ResponseRecord UpdatePndHistory(UpdatePndHistRequest request)
        {
            return new UpdatePndHistServiceCommand(Provider).Execute(request);
        }


        public SearchWarrantyHistoryResponse SearchWarrantyHistory(SearchWarrantyHistoryRequest request)
        {
            return new SearchWarrantyHistoryServiceCommand(Provider).Execute(request);
        }

        public ResponseRecord UpdateWarrantyHistoryory(UpdateWarrantyHistoryRequest request)
        {
            return new UpdateWarrantyHistoryServiceCommand(Provider).Execute(request);
        }


        public SearchWarrantyMessageResponse SearchWarrantyMessage(SearchWarrantyMessageRequest request)
        {
            return new SearchWarrantyMessageServiceCommand(Provider).Execute(request);
        }

        public SearchWarrantyMasterResponse SearchWarrantyMaster(SearchWarrantyMasterRequest request)
        {
            return new SearchWarrantyMasterServiceCommand(Provider).Execute(request);
        }

        public ResponseRecord UpdateWarrantyMaster(UpdateWarrantyMasterRequest request)
        {
            return new UpdateWarrantyMasterServiceCommand(Provider).Execute(request);
        }

        public ResponseRecord UpdateWarrantyMessage(UpdateWarrantyMessageRequest request)
        {
            return new UpdateWarrantyMessageServiceCommand(Provider).Execute(request);
        }
    }
}
